*Figure 1
lowess  gp laggsratio, adjust bwidth(.4)

*Model 1 & Figure 2A
logit gp c.laggsratio##c.laggsratio gpyr gpyr2 gpyr3, cluster(ccode)
margins, dydx( laggsratio ) at( laggsratio =(0 (.1) 1)) vsquish l(95)
marginsplot, recast(line) recastci(rline)

*Model 2 & Figure 2B
logit gp c.laggsratio##c.laggsratio lagmobilization lagbkguer lagmultirebels lagdemdum laglngdppc laglnpop ethnic lagfortroop lagprogovttroops postcoldwar gpyr gpyr2 gpyr3, cluster(ccode)
margins, dydx( laggsratio ) at( laggsratio =(0 (.1) 1)) vsquish l(95)
marginsplot, recast(line) recastci(rline)

*Model 3 & Figure 3
logit gp c.laggsratio##c.laggsratio##c.lnduration lagmobilization lagmultirebels lagbkguer lagdemdum laglngdppc laglnpop ethnic lagfortroop lagprogovttroops postcoldwar gpyr gpyr2 gpyr3, cluster(ccode)
margins, dydx( laggsratio ) at( lnduration =(0 (.1) 4)) vsquish l(95)
marginsplot, recast(line) recastci(rline)

*Model 4 & Figure 4A
logit gp c.laggsratio##c.laggsratio##i.lagmobilization lagbkguer lagmultirebels lagdemdum laglngdppc laglnpop ethnic lagfortroop lagprogovttroops postcoldwar gpyr gpyr2 gpyr3, cluster(ccode)
margins, dydx( laggsratio ) at( laggsratio =(0 (.1) 1)) vsquish l(95) by( lagmobilization)
marginsplot, recast(line) recastci(rline) by( lagmobilization)

*Model 5 & Figure 4B
logit gp c.laggsratio##c.laggsratio##i.lagbkguer lagmobilization lagmultirebels lagdemdum laglngdppc laglnpop ethnic lagfortroop lagprogovttroops postcoldwar gpyr gpyr2 gpyr3, cluster(ccode)
margins, dydx( laggsratio ) at( laggsratio =(0 (.1) 1)) vsquish l(95) by( lagbkguer)
marginsplot, recast(line) recastci(rline) by( lagbkguer)

*Model 6
robvar gp, by(pguer)

